home *** CD-ROM | disk | FTP | other *** search
/ Amiga Mag HDD Backup / Amiga Mag HDD Backup.zip / Amiga Mag HDD Backup / Alexander.img.bin / Alexander.img / tech 4.1 editorial Archive.sit / Nee / sinz.asm < prev   
Assembly Source File  |  1993-07-16  |  20KB  |  841 lines

  1. ;LISTING 2
  2. ;  by William P. Nee
  3. ;     Rt 2, Box 216C
  4. ;     Mason WI  54856-9302
  5. ;SIN(Z) or COS(Z) in double precision
  6.    jmp   start
  7.    include  execmacros.i
  8.    include  intmacros.i
  9.    include  dosmacros.i
  10.    include  gfxmacros.i
  11.    include  dpmathmacros.i
  12.    include  complex.i
  13.    include  menu.i
  14.  
  15. count equr  a2
  16. across   equr  a3
  17. down     equr  a4
  18. depth equ 5
  19.  
  20. @pset  macro         ;<across,down>
  21.    movea.l  rp(pc),a1
  22.    move.w   \1,d0
  23.    add.l    xoffset(pc),d0           ;adjust across
  24.    move.l   yoffset(pc),d1           ;adjust down
  25.    sub.w    \2,d1
  26.    ext.l    d0
  27.    ext.l    d1
  28.    move.l   gfxbase(pc),a6
  29.    jsr      -324(a6)
  30.    endm
  31. @cfm1    macro    ;(branch to if no msg)
  32.    movea.l  window(pc),a0
  33.    move.l   #menunull,d0
  34.    intlib   onmenu
  35.    movea.l  userport(pc),a0
  36.    syslib   getmsg
  37.    tst.l    d0
  38.    beq      \1
  39.    movea.l  d0,a1
  40.    move.l   im.class(a1),d2   ;IDCMP
  41.    move.w   im.code(a1),d3    ;menu#
  42.    syslib   replymsg
  43.    endm
  44. @cfm2     macro   ;(branch to if no msg)
  45.    movea.l  userport(pc),a0
  46.    syslib   getmsg
  47.    tst.l    d0
  48.    beq      \1
  49.    movea.l  d0,a1
  50.    move.l   im.class(a1),d2   ;IDCMP
  51.    move.w   im.code(a1),d3    ;ASCII
  52.    move.w   im.mousex(a1),d5  ;Xcoordinate
  53.    move.w   im.mousey(a1),d6  ;Ycoordinate
  54.    syslib   replymsg
  55.    endm
  56.  
  57. start
  58.    move.l sp,stack               ;save stack pointer
  59.  
  60. open_libs                        ;open all the libraries we need
  61.    openlib     int,done
  62.    openlib     dos,close_int
  63.    openlib     gfx,close_dos
  64.    openlib     dpmath,close_gfx
  65.    openlib     dptrans,close_gfx
  66.    doslib      output
  67.    move.l      d0,conhandler
  68. ;   jmp setup
  69. options
  70.    cls
  71.    linefeed
  72.    right    31
  73.    boldface
  74.    print    titlemsg
  75.    normal
  76.    linefeed
  77.    print    xmsg
  78.    linefeed
  79.    print    palmsg
  80.    linefeed
  81.    print    cmsg
  82.    linefeed
  83.    print    zoommsg
  84.    linefeed
  85.    linefeed
  86.    right    24
  87.    style    italics,orange,black
  88.    print    lmbmsg
  89.    normal
  90.    linefeed
  91. loop
  92.    lmb      loop
  93. setup:            ;open a screen of 320 x 200
  94. make_screen:
  95.    openscreen  myscreen,close_libs
  96. make_window
  97.    openwindow  mywindow,close_screen
  98.    mode        jam1
  99.    palette     colormap1(pc),32
  100.    openmenu    menu0
  101. msg_check
  102.    @cfm1    msg_check
  103.    cmpi.l   #menupick,d2
  104.    bne.s    msg_check
  105.    eval_menunumber
  106.    tst.w    d0
  107.    bne.s    msg_check
  108.    move.w   d1,type
  109.    closemenu
  110. dp_newton_demo
  111. get_values
  112.    removegadgets
  113.    lea      gadget1buffer(pc),a0
  114.    bsr      convertdp
  115.    movedp   c1
  116.  
  117.    lea      gadget2buffer(pc),a0
  118.    bsr      convertdp
  119.    movedp   c2
  120.  
  121.    lea      gadget3buffer(pc),a0
  122.    bsr      convertdp
  123.    movedp   f1
  124.  
  125.    lea      gadget4buffer(pc),a0
  126.    bsr      convertdp
  127.    movedp   f2
  128.  
  129.    lea      gadget5buffer(pc),a0
  130.    bsr      convertdp
  131.    movedp   xleft
  132.  
  133.    lea      gadget6buffer(pc),a0
  134.    bsr      convertdp
  135.    movedp   ytop
  136.  
  137.    lea      gadget7buffer(pc),a0
  138.    bsr      convertdp
  139.    movedp   xright
  140.  
  141.    lea      gadget8buffer(pc),a0
  142.    bsr      convertdp
  143.    movedp   ybottom
  144.    movedp   saveybottom
  145.    bra      requester2  ;draw SMALL or LARGE
  146. scale
  147.    move.l   xlength,d0
  148.    fltdp
  149.    movedp   d0,d6
  150.    movedp   xright,d0
  151.    movedp   xleft,d2
  152.    subdp
  153.    movedp   d6,d2
  154.    divdp
  155.    movedp   xinc              ;x scale
  156.  
  157.    movedp   saveybottom,ybottom
  158.    move.l   ylength,d0
  159.    fltdp
  160.    movedp   d0,d6
  161.    movedp   ytop,d0
  162.    movedp   ybottom,d2
  163.    subdp
  164.    movedp   d6,d2
  165.    divdp
  166.    movedp   yinc              ;y scale
  167.    bra      showit
  168.  
  169. convertdp
  170.    moveq.l  #0,d0
  171.    moveq.l  #0,d1
  172.    moveq.l  #0,d4             ;sign register
  173.    moveq.l  #0,d5
  174.    moveq.l  #0,d7             ;# characters right of decimal
  175.    suba.l   a2,a2             ;clear a2; decimal flag register
  176.    cmpi.b   #'-',(a0)         ;a minus sign?
  177.    bne.s    positive
  178.    bset     #31,d4            ;if so set last bit in d4
  179.    addq.l   #1,a0             ;move over one space
  180. positive
  181. getdigit
  182.    move.b   (a0)+,d5          ;next value to d5
  183.    cmpi.b   #'.',d5           ;a decimal?
  184.    bne.s    testdigit
  185.    move.w   #1,a2             ;if so, flag a2
  186.    clr.l    d7                ; and clear d7
  187.    bra.s    getdigit
  188. testdigit
  189.    cmpi.b   #'9',d5           ;above '9' ?
  190.    bhi.s    zero_check        ;branch if so
  191.    cmpi.b   #'0',d5           ;below '0' ?
  192.    blt.s    zero_check        ;branch if so
  193.    andi.l   #$0f,d5           ;convert ASCII to decimal
  194.  
  195.    movedp   d0,d2             ;must multiply d0 * 10
  196.    asl.l    #1,d1             ;d0 * 2
  197.    roxl.l   #1,d0
  198.    asl.l    #1,d3             ;d2 * 8
  199.    roxl.l   #1,d2
  200.    asl.l    #1,d3
  201.    roxl.l   #1,d2
  202.    asl.l    #1,d3
  203.    roxl.l   #1,d2
  204.    moveq.l  #0,d6
  205.    add.l    d3,d1             ;d0 = d0 + d2
  206.    addx.l   d2,d0
  207.    add.l    d5,d1             ; + this digit
  208.    addx.l   d6,d0
  209.  
  210.    addq.w   #1,d7             ;number of characters done
  211.    cmpi.w   #16,d7            ;up to 15 ?
  212.    bne      getdigit
  213. dperror
  214.    ;moveq    #1,d1            ;optional error flag
  215.    ;rts
  216.    bra      close_window      ;error - close everything!
  217. zero_check
  218.    movea.l  a0,a5             ;return string location
  219.    tst.l    d1                ;don't try to convert 0
  220.    bne.s    get_exponent      ;branch if not 0
  221.    tst.l    d0                ;check second half
  222.    beq.s    dp_done           ;branch if value is 0
  223. get_exponent
  224.    move.l   #$43f,d6          ;maximum exponent
  225. 1$
  226.    subq.l   #1,d6             ;decrease exponent
  227.    asl.l    #1,d1             ;d0 * 2
  228.    roxl.l   #1,d0             ;rotate with carry from d1
  229.    bcc.s    1$                ;branch if no carry
  230.    moveq.l  #11,d5            ;move right 12 bits
  231.  
  232. shift_right
  233.    lsr.l    #1,d0
  234.    roxr.l   #1,d1
  235.    dbra.s   d5,shift_right
  236. adjust_exponent
  237.    swap     d6                ;move to left word
  238.    asl.l    #4,d6             ;move to left end
  239.    or.l     d6,d0             ;put in d0
  240. fraction_check
  241.    cmpa.l   #0,a2             ;any decimal ?
  242.    beq.s    do_sign           ;no
  243.    subq.l   #1,d7             ;decrease number of digits
  244.    bmi.s    do_sign           ;no digits after the decimal
  245.  
  246. decimal_adjust
  247.    move.l   #$40240000,d2     ;dp 10
  248.    moveq.l  #0,d3             ; part 2
  249.    divdp
  250.    dbra.s   d7,decimal_adjust ;do for all digits
  251.  
  252. do_sign
  253.    or.l     d4,d0             ;add sign to d0
  254. dp_done
  255.    moveq.w  #0,d6             ;all is 'ok'
  256.    rts
  257.  
  258. showit
  259.    movea.l  rp(pc),a1
  260.    pcls
  261.    move.l   #1,alldone        ;completed? flag
  262.    move.w   #0,down
  263.    lea      v,a5
  264. l1
  265. ;   movedp   xleft,xx
  266.    move.l   xleft-v(a5),xx-v(a5)
  267.    move.l   xleft+4-v(a5),xx+4-v(a5)
  268.    move.w   #0,across
  269. l2
  270. ;   movedp   xx,a
  271.    move.l   xx-v(a5),a-v(a5)
  272.    move.l   xx+4-v(a5),a+4-v(a5)
  273. ;  movedp   ybottom,b
  274.    move.l   ybottom-v(a5),b-v(a5)
  275.    move.l   ybottom+4-v(a5),b+4-v(a5)
  276.    move.w   #0,count          ;clear the count
  277. l3
  278.    move.w   type(pc),d0
  279. type0
  280.    cmpi.w   #0,d0
  281.    bne      type1
  282.    sinz
  283.    bra      compare
  284. type1
  285.    cmpi.w   #1,d0
  286.    bne      type2
  287.    cosz
  288.    bra      compare
  289. type2
  290.    cmpi.w   #2,d0
  291.    bne      type3
  292.    sinhz
  293.    bra      compare
  294. type3
  295.    cmpi.w   #3,d0
  296.    bne      type4
  297.    coshz
  298.    bra      compare
  299. type4
  300.    expz
  301.  
  302. compare
  303.    fixdp
  304.    cmpi.l   #50,d0
  305.    blo.s    continue
  306.    move.w   count,d0    ;count -> color
  307.    andi.w   #31,d0
  308.    foreground           ;set apen
  309.    @pset    across,down ;pset the point
  310.    bra.s    l4
  311. continue
  312.    addq     #1,count    ;increase count
  313.    cmpa.w   #48,count   ;up to maximum yet ?
  314.    bne      l3          ;branch if not
  315. l4
  316.    adddp    xx,xinc     ;increase xx by xscale
  317.    move.l   d0,xx-v(a5) ;movedp xx,xinc
  318.    move.l   d1,xx+4-v(a5)
  319. check_for_message
  320.    @cfm2    no_message
  321.    cmpi.l   #mousebuttons,d2
  322.    beq      zoom
  323.    tst.l    d3
  324.    beq      no_message
  325.    andi.l   #$0000ffff,d3  ;ASCII value
  326.    cmpi.w   #'1',d3     ;#1
  327.    beq      do_palette1
  328.    cmpi.w   #'2',d3     ;#2
  329.    beq      do_palette2
  330.    cmpi.w   #'3',d3     ;#3
  331.    beq      do_palette3
  332.    cmpi.w   #'4',d3     ;#4
  333.    beq      do_palette4
  334.    cmpi.w   #'5',d3     ;#5
  335.    beq      do_palette5
  336.    cmpi.w   #'6',d3     ;#6
  337.    beq      do_palette6
  338.    cmpi.w   #'7',d3     ;#7
  339.    beq      do_palette7
  340.    cmpi.w   #'8',d3     ;#8
  341.    beq      do_palette8
  342.    cmpi.w   #'9',d3     ;#9
  343.    beq      do_palette9
  344.    cmpi.w   #'0',d3     ;#0
  345.    beq      do_palette0
  346.    cmpi.w   #'c',d3
  347.    beq.s    new_values
  348.    cmpi.w   #'q',d3
  349.    beq      close_window
  350.    cmpi.w   #'x',d3
  351.    beq.s    redraw_it
  352.    bra      no_message
  353. redraw_it
  354.    eori.l   #1,redraw
  355.    beq      draw_small
  356.    bra      draw_large
  357. new_values
  358.    pcls
  359.    closewindow
  360.    bra      make_window
  361. do_palette1
  362.    palette  colormap1(pc),32
  363.    bra      no_message
  364. do_palette2
  365.    palette  colormap2(pc),32
  366.    bra      no_message
  367. do_palette3
  368.    palette  colormap3(pc),32
  369.    bra      no_message
  370. do_palette4
  371.    palette  colormap4(pc),32
  372.    bra      no_message
  373. do_palette5
  374.    palette  colormap5(pc),32
  375.    bra      no_message
  376. do_palette6
  377.    palette  colormap6(pc),32
  378.    bra      no_message
  379. do_palette7
  380.    palette  colormap7(pc),32
  381.    bra      no_message
  382. do_palette8
  383.    palette  colormap8(pc),32
  384.    bra      no_message
  385. do_palette9
  386.    palette  colormap9(pc),32
  387.    bra      no_message
  388. do_palette0
  389.    palette  colormap0(pc),32
  390.    bra      no_message
  391. zoom
  392.    andi.l   #$0000ffff,d5  ;mouse x
  393.    andi.l   #$0000ffff,d6  ;mouse y
  394.    move.l   d5,startx
  395.    move.l   d6,starty
  396.    mode     complement
  397. lmb_down
  398.    @cfm2    lmb1
  399.    cmpi.w   #selectup,d3
  400.    beq      lmb_up
  401. lmb1
  402.    andi.l   #$0000ffff,d5  ;mouse x
  403.    andi.l   #$0000ffff,d6  ;mouse y
  404.    move.l   d5,endx
  405.    move.l   d6,endy
  406.    box      startx,starty,endx,endy,21
  407.    delay    1
  408.    box      startx,starty,endx,endy,21
  409.    bra      lmb_down
  410. lmb_up
  411.    box      startx,starty,endx,endy,21
  412.    mode     jam1
  413. requester1
  414.    movea.l  window(pc),a0
  415.    lea      body1text,a1
  416.    lea      positivetext,a2
  417.    lea      negativetext,a3
  418.    moveq    #0,d0
  419.    moveq    #0,d1
  420.    move.l   #130,d2
  421.    move.l   #50,d3
  422.    intlib   autorequest
  423.    tst.l    d0
  424.    bne      new_coordinates
  425.    mode     complement
  426.    box      startx,starty,endx,endy,21
  427.    mode     jam1
  428.    tst.l    alldone
  429.    beq      now_what ;finished drawing
  430.    bra      check_for_message
  431. new_coordinates
  432. check_them
  433.    move.l   startx,d0
  434.    move.l   endx,d1
  435.    cmp.l    d1,d0
  436.    blo.s    nc1   ;startx < endx
  437.    exg      d1,d0
  438.    move.l   d0,startx
  439.    move.l   d1,endx
  440. nc1
  441.    move.l   starty,d0
  442.    move.l   endy,d1
  443.    cmp.l    d1,d0
  444.    blo.s    nc2   ;starty < endy
  445.    exg      d0,d1
  446.    move.l   d0,starty
  447.    move.l   d1,endy
  448.  
  449. nc2
  450.    move.l   startx,d0
  451.    sub.l    normalizex,d0
  452.    fltdp
  453.    movedp   xinc,d2
  454.    muldp
  455.    adddp    xleft
  456.    movedp   newxleft
  457.    move.l   endx,d0
  458.    sub.l    normalizex,d0
  459.    fltdp
  460.    movedp   xinc,d2
  461.    muldp
  462.    adddp    xleft
  463.    movedp   xright
  464.    movedp   newxleft,xleft
  465.  
  466.    move.l   starty,d0
  467.    sub.l    normalizey,d0
  468.    fltdp
  469.    movedp   yinc,d2
  470.    muldp
  471.    movedp   d0,d2
  472.    movedp   ytop,d0
  473.    subdp
  474.    movedp   newytop
  475.    move.l   endy,d0
  476.    sub.l    normalizey,d0
  477.    fltdp
  478.    movedp   yinc,d2
  479.    muldp
  480.    movedp   d0,d2
  481.    movedp   ytop,d0
  482.    subdp
  483.    movedp   ybottom
  484.    movedp   saveybottom
  485.    movedp   newytop,ytop
  486.  
  487. requester2
  488.    movea.l  window(pc),a0
  489.    lea      body2text,a1
  490.    lea      smalltext,a2
  491.    lea      largetext,a3
  492.    moveq    #0,d0
  493.    moveq    #0,d1
  494.    move.l   #130,d2
  495.    move.l   #50,d3
  496.    intlib   autorequest
  497.    tst.l    d0
  498.    beq      draw_large
  499. draw_small
  500.    move.l   #128,xlength
  501.    move.l   #129,xlength1
  502.    move.l   #128,ylength
  503.    move.l   #129,ylength1
  504.    move.l   #96,xoffset
  505.    move.l   #164,yoffset
  506.    move.l   #96,normalizex
  507.    move.l   #36,normalizey
  508.    move.l   #0,redraw
  509.    bra      scale
  510. draw_large
  511.    move.l   #320,xlength
  512.    move.l   #320,xlength1
  513.    move.l   #200,ylength
  514.    move.l   #200,ylength1
  515.    move.l   #0,xoffset
  516.    move.l   #199,yoffset
  517.    move.l   #0,normalizex
  518.    move.l   #0,normalizey
  519.    move.l   #1,redraw
  520.    bra      scale
  521. no_message
  522.    add.w    #1,across         ;across one space
  523.    cmpa.l   xlength1,across   ;all way across yet ?
  524.    bne      l2                ;branch if not
  525.  
  526.    adddp    ybottom,yinc      ;increase yy by yscale
  527.    movedp   ybottom
  528.    add.w    #1,down           ;down one space
  529.    cmpa.l   ylength1,down     ;all way down yet ?
  530.    bne      l1                ;branch if not
  531.    move.l   #0,alldone        ;finished drawing
  532.  
  533. now_what
  534.    @cfm2    now_what_done
  535.    cmpi.l   #mousebuttons,d2
  536.    beq      zoom
  537.    andi.l   #$0000ffff,d3
  538.    cmpi.w   #'1',d3     :#1
  539.    beq.s    do_palette11
  540.    cmpi.w   #'2',d3     ;#2
  541.    beq      do_palette21
  542.    cmpi.w   #'3',d3     ;#3
  543.    beq      do_palette31
  544.    cmpi.w   #'4',d3     ;#4
  545.    beq      do_palette41
  546.    cmpi.w   #'5',d3     ;#5
  547.    beq      do_palette51
  548.    cmpi.w   #'6',d3     ;#6
  549.    beq      do_palette61
  550.    cmpi.w   #'7',d3     ;#7
  551.    beq      do_palette71
  552.    cmpi.w   #'8',d3     ;#8
  553.    beq      do_palette81
  554.    cmpi.w   #'9',d3     ;#9
  555.    beq      do_palette91
  556.    cmpi.w   #'0',d3     ;#0
  557.    beq      do_palette01
  558.    cmpi.w   #'c',d3
  559.    beq      new_values
  560.    cmpi.w   #'x',d3
  561.    beq      redraw_it
  562.    cmpi.w   #'q',d3
  563.    beq      close_window
  564. now_what_done
  565.    bra      now_what
  566.  
  567. do_palette11
  568.    palette  colormap1(pc),32
  569.    bra      now_what
  570. do_palette21
  571.    palette  colormap2(pc),32
  572.    bra      now_what
  573. do_palette31
  574.    palette  colormap3(pc),32
  575.    bra      now_what
  576. do_palette41
  577.    palette  colormap4(pc),32
  578.    bra      now_what
  579. do_palette51
  580.    palette  colormap5(pc),32
  581.    bra      now_what
  582. do_palette61
  583.    palette  colormap6(pc),32
  584.    bra      now_what
  585. do_palette71
  586.    palette  colormap7(pc),32
  587.    bra      now_what
  588. do_palette81
  589.    palette  colormap8(pc),32
  590.    bra      now_what
  591. do_palette91
  592.    palette  colormap9(pc),32
  593.    bra      now_what
  594. do_palette01
  595.    palette  colormap0(pc),32
  596.    bra      now_what
  597. close_window
  598.    closemenu
  599.    closewindow
  600. close_screen
  601.    closescreen
  602. close_libs
  603.    closelib dpmath
  604.    closelib dptrans
  605. close_gfx
  606.    closelib gfx
  607. close_dos
  608.    closelib dos
  609. close_int
  610.    closelib int
  611. done
  612.    move.l   stack,sp
  613.    rts
  614.  
  615.    evenpc
  616.  
  617. stack       dc.l  0           ;reserve storage locations
  618. gfxbase     dc.l  0
  619. intbase     dc.l  0
  620. dosbase     dc.l  0
  621. dpmathbase  dc.l  0
  622. dptransbase dc.l  0
  623.                               ;library names
  624. gfx         dc.b  'graphics.library',0
  625.    evenpc
  626. int         dc.b  'intuition.library',0
  627.    evenpc
  628. dos         dc.b  'dos.library',0
  629.    evenpc
  630. dpmath      dc.b  'mathieeedoubbas.library',0
  631.    evenpc
  632. dptrans     dc.b  'mathieeedoubtrans.library',0
  633.    evenpc
  634. myscreen:
  635.    dc.w 0,0,320,200,depth     ;depth is 5
  636.    dc.b 0,1
  637.    dc.w 0
  638.    dc.w customscreen
  639.    dc.l 0,0,0,0
  640.    evenpc
  641. mywindow
  642.    dc.w 0,0,320,200
  643.    dc.b 0,1
  644.    dc.l mousebuttons!mousemove!vanillakey!menupick
  645.    dc.l borderless!activate!mousereport!smartrefresh
  646.    dc.l gadget1,0
  647.    dc.l 0
  648.    dc.l 0,0
  649.    dc.w 0,0,0,0
  650.    dc.w customscreen
  651.  
  652.    evenpc
  653. v:
  654. xleft    dc.l  0,0            ;reserve space for both parts
  655. xright   dc.l  0,0
  656. xx       dc.l  0,0
  657. xinc     dc.l  0,0
  658. ybottom  dc.l  0,0
  659. ytop     dc.l  0,0
  660. yinc     dc.l  0,0
  661. startx   dc.l  0
  662. starty   dc.l  0
  663. endx     dc.l  0
  664. endy     dc.l  0
  665. xlength  dc.l  0
  666. xlength1 dc.l  0
  667. xoffset  dc.l  0
  668. normalizex  dc.l  0
  669. ylength  dc.l  0
  670. ylength1 dc.l  0
  671. yoffset  dc.l  0
  672. normalizey  dc.l  0
  673. newxleft dc.l  0,0
  674. newytop  dc.l  0,0
  675. saveybottom dc.l  0,0
  676. alldone  dc.l  0
  677. redraw   dc.l  0
  678. e1       dc.l  0,0
  679. e2       dc.l  0,0
  680. c1       dc.l  0,0
  681. c2       dc.l  0,0
  682. f1       dc.l  0,0
  683. f2       dc.l  0,0
  684. a        dc.l  0,0
  685. b        dc.l  0,0
  686. twodp    dc.l  $40000000,0
  687. type     dc.w  0
  688.    evenpc
  689. colormap1                      ;my new palette
  690.    dc.w  $000,$f0f,$d0f,$b0f,$90f,$70f,$50f,$30f
  691.    dc.w  $10f,$00f,$03d,$05b,$079,$097,$0b5,$0d3
  692.    dc.w  $0f0,$3f0,$6f0,$9f0,$bf0,$df0,$ff0,$fe0
  693.    dc.w  $fd0,$fc0,$fa0,$f80,$f60,$f40,$f20,$f00
  694.    evenpc
  695. colormap2
  696.    dc.w  $000,$f00,$f20,$f40,$f60,$f80,$fa0,$fb0
  697.    dc.w  $fc0,$fd0,$fe0,$ff0,$df0,$af0,$6f0,$3f0
  698.    dc.w  $0f0,$0d3,$0a6,$06a,$03d,$00f,$30d,$60a
  699.    dc.w  $a06,$d03,$f0f,$d0d,$a0a,$606,$303,$202
  700.    evenpc
  701. colormap3
  702.    dc.w  $000,$f00,$d00,$b00,$a00,$800,$600,$500
  703.    dc.w  $300,$200,$100,$0f0,$0d0,$0b0,$0a0,$080
  704.    dc.w  $060,$050,$030,$020,$010,$00f,$00d,$00b
  705.    dc.w  $00a,$008,$006,$005,$004,$003,$002,$001
  706.    evenpc
  707. colormap4
  708.    dc.w  $000,$f00,$e00,$d00,$c00,$b00,$a00,$900
  709.    dc.w  $800,$700,$600,$0f0,$0e0,$0d0,$0c0,$0b0
  710.    dc.w  $0a0,$090,$080,$070,$060,$00f,$00e,$00d
  711.    dc.w  $00c,$00b,$00a,$009,$008,$007,$006,$005
  712.    evenpc
  713. colormap5
  714.    dc.w  $000,$f00,$e20,$d40,$c60,$b80,$aa0,$8b0
  715.    dc.w  $6c0,$4d0,$2e0,$0f0,$0e2,$0d4,$0c6,$0b8
  716.    dc.w  $0aa,$08b,$06c,$04d,$02e,$00f,$00e,$00d
  717.    dc.w  $00c,$00b,$00a,$009,$007,$005,$003,$001
  718.    evenpc
  719. colormap6
  720.    dc.w  $000,$400,$501,$720,$710,$821,$831,$841
  721.    dc.w  $951,$a61,$a71,$a81,$b91,$ba1,$bb2,$cc2
  722.    dc.w  $ac2,$9c2,$7c2,$6c2,$4d2,$2d1,$1d2,$1d4
  723.    dc.w  $1e5,$1e7,$1ea,$1ec,$1ee,$0df,$0bf,$09f
  724.    evenpc
  725. colormap7
  726.    dc.w  $000,$620,$730,$951,$a72,$c93,$db4,$fd5
  727.    dc.w  $ee4,$cd3,$9c2,$7a2,$591,$481,$270,$150
  728.    dc.w  $062,$074,$067,$047,$008,$308,$709,$907
  729.    dc.w  $a05,$a13,$b11,$b43,$c72,$da3,$dd3,$be4
  730.    evenpc
  731. colormap8
  732.    dc.w  $000,$fff,$ecd,$c9c,$b7a,$a59,$837,$726
  733.    dc.w  $559,$66a,$77b,$99b,$aac,$ccd,$dde,$fff
  734.    dc.w  $ded,$cdb,$bc9,$9b7,$8a6,$794,$685,$572
  735.    dc.w  $58a,$69b,$7ab,$9bc,$acd,$bcc,$cee,$fff
  736.    evenpc
  737. colormap9
  738.    dc.w  $000,$fe0,$db0,$c90,$a60,$950,$730,$620
  739.    dc.w  $fe0,$af0,$3f0,$0f3,$0fa,$0df,$07f,$00f
  740.    dc.w  $fe0,$eb0,$c90,$b90,$a60,$940,$730,$620
  741.    dc.w  $fe0,$de0,$ad0,$7c0,$5b0,$3a0,$270,$080
  742.    evenpc
  743. colormap0
  744.    dc.w  $000,$004,$008,$00b,$00f,$00b,$008,$004
  745.    dc.w  $000,$430,$770,$ba0,$fe0,$ba0,$860,$430
  746.    dc.w  $000,$300,$700,$a00,$e00,$a00,$700,$300
  747.    dc.w  $000,$020,$040,$060,$080,$060,$040,$020
  748.    evenpc
  749. menus
  750.    makemenu menu0,'Project',,0,1
  751.     makeitem menu0item0,'Sin(Z)',menu0item1,0,$153,$1e
  752.     makeitem menu0item1,'Cos(Z)',menu0item2,10,$53,$1d
  753.     makeitem menu0item2,'Sinh(Z)',menu0item3,20,$53,$1b
  754.     makeitem menu0item3,'Cosh(Z)',menu0item4,30,$53,$17
  755.     makeitem menu0item4,'Exp(Z)',,40,$53,$f
  756.    evenpc
  757. messages
  758. titlemsg dc.b  'COMPLEX ITERATIONS',0
  759.    evenpc
  760. cmsg     dc.b  ' press c for main menu',0
  761.    evenpc
  762. xmsg     dc.b  ' press x to switch picture size',0
  763.    evenpc
  764. palmsg   dc.b  ' press 0 - 9 to change palettes',0
  765.    evenpc
  766. zoommsg  dc.b  ' use the LMB to draw a ZOOM box',0
  767.    evenpc
  768. lmbmsg   dc.b  'NOW PRESS THE LEFT MOUSE BUTTON',0
  769.    evenpc
  770. gadgets
  771.    makestrgadget gadget1,'C1',gadget2,40,75,100,9,$0,$1,$0,1,15
  772.    makestrgadget gadget2,'iC2',gadget3,180,75,100,9,$0,$1,$0,2,15
  773.    makestrgadget gadget3,'F1',gadget4,40,100,100,9,$0,$1,$0,3,15
  774.    makestrgadget gadget4,'iF2',gadget5,180,100,100,9,$0,$1,$0,4,15
  775.    makestrgadget gadget5,'Xleft',gadget6,40,150,100,9,$0,$1,$0,5,15
  776.    makestrgadget gadget6,'Ytop',gadget7,110,125,100,9,$0,$1,$0,6,15
  777.    makestrgadget gadget7,'Xright',gadget8,180,150,100,9,$0,$1,$0,6,15
  778.    makestrgadget gadget8,'Ybot',0,110,175,100,9,$0,$1,$0,8,15
  779.    evenpc
  780. gadget1buffer  dc.b  '1.00000000000',0 ;C1
  781.    evenpc
  782. gadget2buffer  dc.b  '0.00000000000',0 ;iC2
  783.    evenpc
  784. gadget3buffer  dc.b  '0.00000000000',0 ;F1
  785.    evenpc
  786. gadget4buffer  dc.b  '0.00000000000',0 ;iF2
  787.    evenpc
  788. gadget5buffer  dc.b  '-4.0000000000',0 ;Xleft
  789.    evenpc
  790. gadget6buffer  dc.b  '4.50000000000',0 ;Ytop
  791.    evenpc
  792. gadget7buffer  dc.b  '4.00000000000',0 ;Xright
  793.    evenpc
  794. gadget8buffer  dc.b  '-4.5000000000',0 ;Ybot
  795.    evenpc
  796.  
  797. simple_requesters
  798. body1text    ;intui-text structure for body text
  799.    dc.b     0,1,1,0
  800.    dc.w     0,0
  801.    dc.l     0,body1string,0
  802.    evenpc
  803. body1string  dc.b  'OK to ZOOM ?',0
  804.    evenpc
  805. positivetext
  806.    dc.b     0,1,1,0
  807.    dc.w     0,0
  808.    dc.l     0,positivestring,0
  809.    evenpc
  810. positivestring dc.b  'YES',0
  811.    evenpc
  812. negativetext
  813.    dc.b     0,1,1,0
  814.    dc.w     0,0
  815.    dc.l     0,negativestring,0
  816.    evenpc
  817. negativestring dc.b  'NO!',0
  818.    evenpc
  819. body2text
  820.    dc.b     0,1,1,0
  821.    dc.w     0,0
  822.    dc.l     0,body2string,0
  823.    evenpc
  824. body2string dc.b  'What Size ?',0
  825.    evenpc
  826. smalltext
  827.    dc.b     0,1,1,0
  828.    dc.w     0,0
  829.    dc.l     0,smallstring,0
  830.    evenpc
  831. smallstring dc.b  'SMALL',0
  832.    evenpc
  833. largetext
  834.    dc.b     0,1,1,0
  835.    dc.w     0,0
  836.    dc.l     0,largestring,0
  837.    evenpc
  838. largestring dc.b  'LARGE',0
  839.    evenpc
  840.    end
  841.